The WMI42 Sample

The WMI42 Sample accompanies Chapter 10 and illustrates the most basic WMI calls.

The sample includes two components:

Building WMI42

To build WMI42.SYS, follow the general instructions for building a WDM sample. The Microsoft Visual C++ project file is named WMI42.DSP in the SYS subdirectory.

To build TEST.EXE, follow the general instructions for building user-mode programs. The Microsoft Visual C++ project file is named TEST.DSP in the TEST subdirectory. To build this test program, you need to have the INCLUDE directory from the Platform SDK in the directories path.

Depending on which version of the Platform SDK you've installed, you may need to take the following additional steps to build TEST.EXE:

Testing WMI42

Install the WMI42 "device." Follow the general instructions for using FastInst in Windows 2000 or the Add New Hardware wizard in Windows 98. The INF file is named SYS\WMI42.INF.

If you're testing in Windows 98, please refer to the general instructions for WMI in Windows 98 for additional information.

Once you’ve installed WMI42, open a command prompt and launch TEST.EXE (in the TEST\DEBUG subdirectory). It will read and report the current value of the Answer property. Then it will change the property value to be one higher. Successive invocations of test will print successively higher numbers.